#ifndef __TIMER_H
#define __TIMER_H

#include <scos.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct tmr_s
{
  struct timeval started;
  struct timeval stopped;
  double accumulated;
} tmr_t;

tmr_t tmrInit(void);
void tmrStart(tmr_t *timer);
void tmrStop(tmr_t *timer);
void tmrResume(tmr_t *timer);
double tmrGetValueInUs(const tmr_t *timer);
void tmrSetValueInUs(tmr_t *timer, double value);

#ifdef __cplusplus
}
#endif

#endif /* __TIMER_H */
